<template>
    <a-input-password v-model="password" v-bind="$attrs" @blur="onChange">
    </a-input-password>
</template>

<script>
    import md5 from 'md5'
    export default {
        name: "xlPassword",
        data() {
            return {
                password:''
            }
        },
        props:{
            value:String
        },
        model: {
            prop: 'value',
            event: 'change'
        },
        created(){
          this.password = this.value
        },
        watch:{
            value(){
                this.password = this.value
            }
        },
        methods:{
            onChange(){
                this.$emit('change',md5(this.password))
            }
        }
    }
</script>

<style scoped>

</style>
